import dayjs, { type Dayjs, type ConfigType } from "../utils/dayjs";

// wrapDate to the start of the day
export const wrapDate = (date: ConfigType): Dayjs => {
  return dayjs(date).startOf("day");
};

export const getDates = (start: ConfigType, end: ConfigType): Dayjs[] => {
  const startDate = wrapDate(start);
  const endDate = wrapDate(end);
  const deltaDays = endDate.diff(startDate, 'day');
  return Array.from({ length: deltaDays + 1 }, (_, i) => startDate.add(i, 'day'));
};